import { argType } from "./IPublisher";

/**
 * 分享能力
 */
export class IShareAble{
    protected _type:string;
    /**
     * 初始化
     * @param type 功能类型，如：wx;tt等
     */
    init(type:string):IShareAble{
        if(!this._type){
            this._type = type;
        }
        return this;
    }

    shareText(data:string|argType[], caller?:any, onSuccess?:Function, onFail?:Function):void{
        console.log("分享了文本信息：", data);
        onSuccess && onSuccess.apply(caller);
    }

    shareImage(data:string|argType[], caller?:any, onSuccess?:Function, onFail?:Function):void{
        console.log("分享了图片信息：", data);
        onSuccess && onSuccess.apply(caller);
    }

    shareVideo(data:string|any[], caller?:any, onSuccess?:Function, onFail?:Function):void{
        console.log("分享了视频信息：", data);
        onSuccess && onSuccess.apply(caller);
    }
}
